clear;


 load('datamarketG2')

dt=0.01;
T1=20;
t1=0:dt:T1;
nt1=length(t1);
nmk(1)=ss(1);
ds=ss(2)-ss(1);


 

 gnmk2=phiXmk2(1:flagstarmk2)-phiImk2(1:flagstarmk2);
 
 for i=2:nt1
nmk(i)=nmk(i-1)+gnmk2(floor((nmk(i-1)-ss(1))/ds)+1)*dt;
 end

 for i=1:nt1
mxt2(i)=mx2(floor((nmk(i)-ss(1))/ds)+1);
end
 for i=1:nt1
rpust2(i)=rpU2(floor((nmk(i)-ss(1))/ds)+1)-rpS2(floor((nmk(i)-ss(1))/ds)+1);
 end
 

 
 
 
 
 

 subplot(1,2,1)


plot(t1,mxt2,'LineWidth',1.5)
 hold on;

 
xlabel('$t$','interpreter','latex','FontSize',12)
title('A. $m_t$','interpreter','latex','FontSize',12)

axis('square') 


   subplot(1,2,2)


plot(t1,rpust2,'LineWidth',1.5)
 hold on;

 
xlabel('$t$','interpreter','latex','FontSize',12)
title('B. wedge: $r^U_t-r^S_t$','interpreter','latex','FontSize',12)
axis('square') 
%reportnew2;
print -depsc figure_base_mwedge_stateGt5_new


 